home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PCMania 73
/
PCMania CD73_1.iso
/
sharewar
/
utiles
/
viff
/
viff.h
< prev
next >
Wrap
C/C++ Source or Header
|
1998-02-18
|
4KB
|
163 lines
/************************* -*- Mode: C -*- *****************************
*
* viff.h -- common header file for viff files
*
* Copyright (C) 1996-1998 Richard Flamsholt S0rensen. All rights reserved.
*
* Author : Richard Flamsholt S0rensen
* Created On : Wed Dec 18 16:08:57 1996
* Last Modified By: Richard Flamsholt S0rensen
* Last Modified On: Wed Feb 18 14:02:18 1998
* Update Count : 55
* Revision History: None
*
* COMMENTS
* HISTORY
**********************************************************************/
#if defined(UNIX)
# define PLATFORM "Unix"
#elif defined(MSDOS)
# define PLATFORM "DOS"
#elif defined(WIN32)
# define PLATFORM "Win32"
#else
# error No platform specified
#endif
#if defined(BC31)
# define COMPILER "BC"
#elif defined(MSVC)
# define COMPILER "MSVC"
#elif defined(DJGPP)
# define COMPILER "djgpp"
#elif defined(SCO)
# define COMPILER "cc"
#else
# error No compiler specified
#endif
#ifdef MSVC
/* disable warning about a bitmask-packing in PDcurses */
#pragma warning(disable:4121)
#include <curses.h>
#pragma warning(default:4121)
#else
#include <curses.h>
#endif
typedef int BOOLEAN;
#ifndef TRUE
#define TRUE 1
#endif
#ifndef FALSE
#define FALSE 0
#endif
#include "viffutil.h"
#define VERSION "v2.11"
#define DIFFCMD "diff"
#ifndef FILENAME_MAX /* some stdio.h's may not define this */
#define FILENAME_MAX 256
#endif
#ifdef UNIX
#define SEPCHAR '/' /* path separator (\dir\file) */
#define PATHSEP ":" /* separator in PATH variable */
#else
#define SEPCHAR '\\'
#define PATHSEP ";"
#endif
#define MIN(x,y) ((x)<(y)?(x):(y))
#define MAX(x,y) ((x)<(y)?(y):(x))
#define ARRAYSIZE(x) ((sizeof(x)/sizeof(*(x))))
#ifndef KEY_ESCAPE
#define KEY_ESCAPE 0x1b
#endif
#ifndef KEY_END
#define KEY_END 0x166 /* at least on PDcurses it is */
#endif
#ifndef KEY_DELETE
#define KEY_DELETE 0x7f
#endif
#define KEYRETURN(key) ((key)=='\n' || (key)=='\r')
#define KEYABORT(key) ((key)==KEY_ESCAPE || (key)==KEYCTRL('G'))
#define KEYCTRL(key) ((key)-'A'+1)
/*### accept more chars! */
#define PRINTABLE_CHAR(ch) \
((ch)=='\t' || (ch) >= 0x20 && (ch) != KEY_DELETE)
/* ((ch)=='\t' || 0x20<=((ch)&0x7f) && (ch)!=0x7f && (ch)<0x100) */
#define INPUT_NUMERIC 0x01
#define STATUSLINES 1
#define VIEWLINES (LINES-STATUSLINES)
#define SCROLLSIGHT 3
#define PAGELINES (VIEWLINES-SCROLLSIGHT) /* pgup/dn: n lines overlap */
#define DIFFSIGHT 2
typedef enum { /* keep real text <= COMMON */
DIFF, COMMON, TOPSEP, MIDSEP, BOTSEP
} LINETYPE;
#define SYSLINE(line) (COMMON < (LINETYPE)(line)->type)
typedef struct {
char *txt; /* not asciiz string; see len */
int len; /* length of line */
int room; /* allocated space for txt */
int line1;
int line2;
unsigned incl : 1;
unsigned broken: 1;
unsigned new : 1;
unsigned type : 3; /* system or plain text line */
} LINE;
extern char *viffdate;
extern chtype viff_attr;
extern chtype edit_attr;
extern chtype status_attr;
extern int topln;
extern int diffbeg, diffmid, diffend;
extern LINE *linetbl;
extern int nline;
extern int linetblsiz;
extern int tabwidth;
extern BOOLEAN modified;
extern int Scrollx;
extern BOOLEAN curses_on;
extern char *diffcmd;
extern char *options;
extern BOOLEAN verbose;
extern BOOLEAN report;
extern BOOLEAN brief_report;
extern BOOLEAN ignoreheaders;
extern BOOLEAN monochrome;
#define STATUS_RATING 0x01
#define STATUS_HELP 0x02
void statusline(unsigned flags, const char *fmt, ...);
int vstatusline(unsigned flags, const char *fmt, va_list varg);
BOOLEAN confirm_quit(void);
void edit_statusline(LINE *line, int memx, int winx);
void statusline_info(void);
void help(char *text[], int nlines);
void set_topline(int ln);
void putline(int ln);
void goto_curr_diff(BOOLEAN center);
void goto_nearest_diff(int ln);
extern void init_edit_mode(void);
extern void edit_mode(void);
extern void goto_next_page(void);
extern void goto_prev_page(void);
extern void search(int search_key);